package com.tjetc.序列化;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class T02反序列化 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        //创建一个对象输入流
        ObjectInputStream objectInputStream = new ObjectInputStream(new FileInputStream("person.txt"));
        Object person = (Person)objectInputStream.readObject();
/*        Object person2 = (Person)objectInputStream.readObject();
        Object person3 = (Person)objectInputStream.readObject();*/
        //输出
        System.out.println(person);
  /*      System.out.println(person2);
        System.out.println(person3);*/
        objectInputStream.close();
    }
}
